package functions;

import Database.Db_handler;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import com.example.Views.MyActivity;
import com.example.Views.R;

import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: MoiMini
 * Date: 06/10/13
 * Time: 20:06
 * To change this template use File | Settings | File Templates.
 */


public class Init{
    Db_handler dbHandler;
    Context context;
    barcode_gen codebar;

    public Init(Context context){
        this.context= context;
        dbHandler = new Db_handler(context);
    }


    public void Init_item(item product) {
        dbHandler.Add_item(product);
    }

    public ArrayList show_all(){
        ArrayList<item> myitems;
        myitems = dbHandler.Get_items();
        return (myitems);
    }

    public void generate_Qr(item product) {
        codebar = new barcode_gen(product.getSku());
    }


}
